{include file="public/head"}
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
	<body>
		<header class="mui-bar mui-bar-nav report-header box-s" id="header">
			<a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
			<p>订单支付</p>
	    </header>
	    <div id="main" class="mui-clearfix contaniner sorder">
	    	<div class="warning clearfloat box-s" >
    			交易超过24小时将自动关闭
    		</div>    	
	    	<div class="warning clearfloat box-s" style="height:60px;line-height: 60px;text-align:center;">
    			收货地址:{$data.receive_address}
    		</div>
    		<div class="odernum clearfloat">
    			<ul>
    				<li>您的订单号：{$data.out_order_no}</li>
    				<li>应付金额：<span>￥{$data.order_money}</span></li>
    			</ul>
    		</div>
    		<div class="pay-method clearfloat">
    			<ul>
    				<li>支付方式</li>
    			</ul>
    		</div>
	    	<div class="addlist clearfloat">
	    		
	    		<div class="bottom clearfloat box-s">
	    			<section class="shopcar clearfloat">
						<div class="radio radiosss fr"> 
						    <label>
						        <input type="radio" name="sex" value="" checked>
						        <div class="option"></div>
						    </label>
						</div>
						<div class="sorder-list clearfloat fl">
							<i class="iconfont icon-zhifubao fl"></i>
							<div class="zuo fl">
								<p class="tit">支付宝</p>
								<p class="fu-tit">客户端支持最便捷！可银行卡支付！</p>
							</div>							
						</div>
					</section>
	    		</div>
	    		<!--<div class="bottom clearfloat box-s">
	    			<section class="shopcar clearfloat">
						<div class="radio fr"> 
						    <label>
						        <input type="radio" name="sex" value="">
						        <div class="option"></div>
						    </label>
						</div>
						<div class="sorder-list clearfloat fl">
							<i class="iconfont icon-yinxingqia fl"></i>
							<div class="zuo fl">
								<p class="tit">银行卡</p>
								<p class="fu-tit">需要先开通网银</p>
							</div>							
						</div>
					</section>
	    		</div>-->
	    	</div>
	    	
	    	<a href="#" class="address-add fl" onclick="createorder('{$data.order_id}')">
	     		确认支付
	     	</a>
	    </div>
	    
	</body>
	<script type="text/javascript">
		$(".shopcar-checkbox label").on('touchstart',function(){
			if($(this).hasClass('shopcar-checkd')){
				$(".shopcar-checkbox label").removeClass("shopcar-checkd")
			}else{
				$(".shopcar-checkbox label").addClass("shopcar-checkd")
			}
		})
	</script>
</html>
<script type="application/javascript">
	function createorder(id){

		var url = '{:url("shop/shop/createorder")}'
		$.get(url, {order_id: id}, function(r){
			
			if (r.order_no) {
				tradePay(r.order_no)
			}else{
				alert(r.info)
                //location.reload()  
			}
		})
	}
	
	// 由于js的载入是异步的，所以可以通过该方法，当AlipayJSBridgeReady事件发生后，再执行callback方法
	function ready(callback) {
		 if (window.AlipayJSBridge) {
			 callback && callback();
		 } else {
			 document.addEventListener('AlipayJSBridgeReady', callback, false);
		 }
	}

	function tradePay(tradeNO) {
		ready(function(){
			 // 通过传入交易号唤起快捷调用方式(注意tradeNO大小写严格)
			 AlipayJSBridge.call("tradePay", {
				  tradeNO: tradeNO
			 }, function (data) {
				 if ("9000" == data.resultCode) {
					 
					 window.location.href='http://p.alipay.com/P/ZnbM272z';
				 }
			 });
		});
	}
</script>
</script>